<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_sn')->default('')->comment('订单号');
            $table->string('user_id')->default('')->comment('用户id');
            $table->decimal('amount')->comment('金额');
            $table->string('payway')->default('');
            $table->string('status')->default('')->comment('状态');
            $table->string('transaction_id')->default('')->comment('支付平台订单号');
            $table->string('description')->nullable()->comment('订单描述');
            $table->string('completed_at')->nullable()->comment('订单完成时间');
            $table->string('callback_data')->nullable()->comment('返回的所有数据');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order');
    }
}
